package ru.ifmo.rybakov.muclumon;

import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
@DiscriminatorValue("c")
public class ClusterState extends Element {
	@ManyToOne
	@JoinColumn(name = "reference")
	private Cluster cluster;
	
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "clusterState")
	private Collection<NodeState> nodeStates;
	
	/**
	 * Returns the cluster
	 * @return The cluster
	 */
	public Cluster getCluster() {
		return cluster;
	}

	/**
	 * Sets the cluster value
	 * @param cluster The cluster to be set
	 */
	public void setCluster(Cluster cluster) {
		this.cluster = cluster;
	}

	/**
	 * Returns the nodeStates
	 * @return The nodeStates
	 */
	public Collection<NodeState> getNodeStates() {
		return nodeStates;
	}

	/**
	 * Sets the nodeStates value
	 * @param nodeStates The nodeStates to be set
	 */
	public void setNodeStates(Collection<NodeState> nodeStates) {
		this.nodeStates = nodeStates;
	}
}
